//
//  GpsClass.m
//  easyTaxi
//
//  Created by ellenpage on 13-4-24.
//  Copyright (c) 2013年 ellenpage. All rights reserved.
//

#import "GpsClass.h"

#import <MapKit/MapKit.h>

#import <CoreLocation/CoreLocation.h>

#import "PassValueClass.h"

@interface GpsClass ()<CLLocationManagerDelegate>

@property (strong, nonatomic) CLLocationManager *location;
@property (strong, nonatomic) CLLocationManager *locationManager;

//@property (strong, nonatomic)

@end

@implementation GpsClass

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {        
        self.locationManager = [[CLLocationManager alloc] init];
        self.locationManager.delegate = self;
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
        self.locationManager.distanceFilter = kCLDistanceFilterNone;
        [self.locationManager startUpdatingLocation];
        [self.locationManager stopUpdatingLocation];
        CLLocation *location = [self.locationManager location];
        
        float longitude = location.coordinate.longitude;
        float latitude  = location.coordinate.latitude;
        
        [PassValueClass sharedIntance].lat_Tianze = latitude;
        [PassValueClass sharedIntance].lon_Tianze = longitude;
    }
    return self;
}

@end
